<?php

include '../php-ofc-library/open-flash-chart.php';

//set data here
srand((double)microtime()*1000000);
$data = array();
for( $i=0; $i<10; $i++ )
  $data[] = rand(15,100);

$title = new title( 'Chart 1: Disk Storage State' );
$title->set_style('{font-size: 20px; color:#0000ff; font-family: Verdana; text-align: center}');

//set chart type here
$bar = new bar_glass();
$bar->set_values( $data );
$bar->colour = '#D54C78';


//set labels here
$x_labels=new x_axis_labels();
$x_labels->set_labels(array('DS_1','DS_2','DS_3','DS_4','DS_5','DS_6','DS_7','DS_8','DS_9','DS_10'));
$x_axis = new x_axis();
$x_axis->set_labels($x_labels);
$x_legend = new x_legend( 'Data Server' );
$x_legend->set_style( '{font-size: 16px; color: #000000}' );

$y_axis = new y_axis();
$y_axis->set_range( 0,100,10 );//set_range(min,max,step)
$y_axis->set_label_text('#val#%');
$y_legend = new y_legend( 'Storage Used/All' );
$y_legend->set_style( '{font-size: 16px; color: #000000}' );


$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $bar );
$chart->set_x_axis( $x_axis );
$chart->set_y_axis( $y_axis );
$chart->set_x_legend( $x_legend );
$chart->set_y_legend( $y_legend );

echo $chart->toPrettyString();

?>
